express = require 'express'
Tick = require '../models/tick'
router = express.Router()

router.get '/',(req,res,next)->
  Tick.find (err,ticks)->
    res.send ticks unless err

router.post '/',(req,res,next)->
  tick =new Tick(req.body)
  tick.save (err)->
    res.json 'result':'success' unless err

module.exports = router
